﻿@model IEnumerable<OnlineBookstore.Models.BookDetailsInfo>

@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>后台管理</title>
    <link rel="stylesheet" href="~/conjs/global.css" />
    <link href="~/conjs/cityLayout.css" type="text/css" rel="stylesheet">
    <link rel="stylesheet" href="~/conjs/Site.css" />
    <style>
        :root {
            --primary-color: #2c3e50;
            --secondary-color: #ecf0f1;
            --accent-color: #e74c3c;
        }

        .book-container {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 2rem;
            padding: 2rem 5%;
        }

        .book-card {
            background: white;
            border-radius: 10px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s ease;
            overflow: hidden;
        }

            .book-card:hover {
                transform: translateY(-5px);
            }

        .book-cover {
            width: 100%;
            height: 300px;
            object-fit: cover;
            border-bottom: 2px solid var(--secondary-color);
        }

        .book-info {
            padding: 1.5rem;
        }

        .book-title {
            font-size: 1.2rem;
            color: var(--primary-color);
            margin-bottom: 0.5rem;
            font-weight: 600;
        }

        .book-meta {
            color: #7f8c8d;
            font-size: 0.9rem;
            margin-bottom: 0.3rem;
        }

        .book-price {
            color: var(--accent-color);
            font-size: 1.4rem;
            font-weight: bold;
            margin: 1rem 0;
        }

        .action-button {
            display: block;
            width: 100%;
            padding: 0.8rem;
            background-color: var(--primary-color);
            color: white;
            text-align: center;
            border-radius: 5px;
            text-decoration: none;
            transition: background-color 0.3s ease;
        }

            .action-button:hover {
                background-color: var(--accent-color);
            }

        .return-link {
            display: inline-block;
            margin: 2rem 5%;
            padding: 0.8rem 1.5rem;
            background-color: var(--secondary-color);
            color: var(--primary-color);
            border-radius: 5px;
            text-decoration: none;
        }
    </style>
</head>
<body>
    <div id="all">
        <!-- 页眉保持不变 -->
        <div id="header">...</div>

        <div class="book-container">
            @foreach (var item in Model)
            {
                <div class="book-card">
                    <img src="@Html.DisplayFor(modelItem => item.Bookcover)" class="book-cover" alt="@item.BookName 封面">
                    <div class="book-info">
                        <h3 class="book-title">@item.BookName</h3>
                        <div class="book-meta">编号: @item.BookCode</div>
                        <div class="book-meta">作者: @item.BookAuthor</div>
                        <div class="book-meta">出版社: @item.Bookpress</div>
                        <div class="book-meta">分类: @item.Booksort</div>
                        <div class="book-price">¥@item.BookPrice.ToString("0.00")</div>
                        @Html.ActionLink("立即购买", "GetBookDetails", new { id = item.Id }, new { @class = "action-button" })
                    </div>
                </div>
            }
        </div>

        @Html.ActionLink("返回首页", "Index", null, new { @class = "return-link" })

        <!-- 页脚保持不变 -->
        <div id="footer">...</div>
    </div>

    <!-- 脚本引用保持不变 -->
</body>
</html>